﻿@model BankCreditPortfolio.Models.BankModels.OrderInfoModel
@{
    ViewBag.Title = "OrderInfo";
    //Layout = "~/Views/Shared/_Layout.cshtml";
}
<strong>Order Info</strong>
<p>Here you can see received orders for credits.</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Styles/forms.css")" rel="stylesheet" type="text/css" />

<script type="text/javascript">
    $(document).ready(function () {
        $("form").submit(function () {
            $("#ApproveButton").hide();
            $("#RejectButton").hide();
        });
    });
</script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary()
    <fieldset>
        <legend>Order Information</legend>
        <div class="editor-label">
            @Html.LabelFor(m => m.TariffTitle)
        </div>
        <div class="editor-field">
            @Html.ActionLink(Model.TariffTitle, "Tariff", "Home", new { tariffId = Model.TariffId }, new { target = "_blank" })
        </div>
        <div class="editor-label">
            @Html.LabelFor(m => m.Amount)
        </div>
        <div class="editor-field">
            @Html.DisplayTextFor(m => m.Amount)
        </div>
        <div class="editor-label">
            @Html.LabelFor(m => m.Currency)
        </div>
        <div class="editor-field">
            @Html.DisplayTextFor(m => m.Currency)
        </div>
        <div class="editor-label">
            @Html.LabelFor(m => m.Status)
        </div>
        <div class="editor-field">
            @Html.DisplayTextFor(m => m.Status)
        </div>
        @if (Model.DocumentsRequired)
        {
        <div class="editor-label">
            @Html.LabelFor(m => m.DocPath)
        </div>
         <div class="editor-field">
            <a href="@Model.DocPath">Download Documents</a> 
        </div>
        }
    </fieldset>

	<div class="footr">
        <span>
            @Html.ActionLink("Order History", "OrderHistory", new { orderId = Model.OrderId }, new { target = "_blank" })
        </span>
		@if (Model.GuarantorExists)
  { <span>
			@Html.ActionLink("Guarantor", "GuarantorInfo", new { guarantorId = Model.GuarantorId }, new { target = "_blank" })
		</span>} <span>
			@Html.ActionLink("Client", "ClientInfo", new { clientId = Model.ClientId }, new { target = "_blank" })
		</span><span>
            <input type="submit" id="ApproveButton" name="submitButton" value="Approve"/>
		</span><span>
            <input type="submit" id="RejectButton" name="submitButton" value="Reject"/>
		</span>
	</div>
    
    <div class="editor-label">
        @Html.LabelFor(m => m.Comment)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(m => m.Comment)
    </div>
}